package com.example.demo.juc.lock;

/**
 * @Description:
 * @Author: xiatian
 * @CreateTime: 2021/8/24
 * @Company: kangxu
 */

public class WaitTest1 extends Thread {
    private Object look;

    public WaitTest1(Object look) {
        this.look = look;
    }

    @Override
    public void run() {
        try {
            synchronized (look) {
                System.out.println("wait start...");
                look.wait();
                System.out.println("wait end...");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
